﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Collections;
namespace BallData
{
    public class FilterCloseVS : IListenFilter
    {
        private MainUIControl uicontrol;

        public MainUIControl Uicontrol
        {
            get { return uicontrol; }
            set { uicontrol = value; }
        }

        private Hashtable hashresult;

        public Hashtable Hashresult
        {
            get { return hashresult; }
            set { hashresult = value; }
        }

        public void OnListenFilter(Bet007_Match bi, Match_FilterItemBind fi, Bet007_AnalysisData ba)
        {
            if (fi.bFilter)
            {
                ObservableCollection<MatchListDataTemple> matchlist = OddsUntil.LeagueViewTemple[OddsUntil.Filter_MatchName] as ObservableCollection<MatchListDataTemple>;
                MatchItem ci = Gooooal_NetDataHelper.matchdataobj.getMatchItemByName(bi.t1CnName);

                

                //近期主队战绩过滤
                //"连胜", "连平","连负","连赢盘","连走盘" "连输盘","连续大球","连续小球"

                if (ci == null)
                    ci = Gooooal_NetDataHelper.matchdataobj.getMatchItemByName(new List<String>{bi.t1CnName,bi.t2CnName,bi.t1EnName,bi.t2EnName,bi.t1TrName,bi.t2TrName});
                if (ci == null)
                    return;


                #region 连胜
                if (fi.szSelectFilterType == "连胜")
                {
                    int wincomeon = 0;
                    List<int> wincount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hosthistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "胜")
                        {
                            wincomeon++;
                        }
                        else
                        {
                            if (wincomeon > 0)
                                wincount.Add(wincomeon);
                            wincomeon = 0;
                        }
                    }

                    foreach (int data in wincount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if(Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }
                            
                        
                        }
                    
                    }

                }
                #endregion
                #region 连平
                if (fi.szSelectFilterType == "连平")
                {
                    int pingmore = 0;
                    List<int> pingmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hosthistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "平")
                        {
                            pingmore++;
                        }
                        else
                        {
                            if (pingmore > 0)
                                pingmorecount.Add(pingmore);
                            pingmore = 0;
                        }
                    }

                    foreach (int data in pingmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }

                        }

                    }

                }
                #endregion
                #region 连负
                if (fi.szSelectFilterType == "连负")
                {
                    int fumore = 0;
                    List<int> fumorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hosthistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "负")
                        {
                            fumore++;
                        }
                        else
                        {
                            if (fumore > 0)
                                fumorecount.Add(fumore);
                            fumore = 0;
                        }
                    }

                    foreach (int data in fumorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连赢盘
                if (fi.szSelectFilterType == "连赢盘")
                {
                    int winpanlu = 0;
                    List<int> winpanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hosthistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "赢")
                        {
                            winpanlu++;
                        }
                        else
                        {
                            if (winpanlu > 0)
                                winpanlucount.Add(winpanlu);
                            winpanlu = 0;
                        }
                    }

                    foreach (int data in winpanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连走盘
                if (fi.szSelectFilterType == "连走盘")
                {
                    int zoupanlu = 0;
                    List<int> zoupanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hosthistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "走")
                        {
                            zoupanlu++;
                        }
                        else
                        {
                            if (zoupanlu > 0)
                                zoupanlucount.Add(zoupanlu);
                            zoupanlu = 0;
                        }
                    }

                    foreach (int data in zoupanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连输盘
                if (fi.szSelectFilterType == "连输盘")
                {
                    int shupanlu = 0;
                    List<int> shupanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hosthistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "输")
                        {
                            shupanlu++;
                        }
                        else
                        {
                            if (shupanlu > 0)
                                shupanlucount.Add(shupanlu);
                            shupanlu = 0;
                        }
                    }

                    foreach (int data in shupanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                                
                            }

                        }

                    }

                }
                #endregion
                #region 连续大球
                if (fi.szSelectFilterType == "连续大球")
                {
                    int bigmore = 0;
                    List<int> bigmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hosthistorylist)
                    {
                        if (OddsUntil.overUnder[Convert.ToInt32(hvs.overunder) + 1] == "大")
                        {
                            bigmore++;
                        }
                        else
                        {
                            if (bigmore > 0)
                                bigmorecount.Add(bigmore);
                            bigmore = 0;
                        }
                    }

                    foreach (int data in bigmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if ( Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }
                           
                        }

                    }

                }
                #endregion
                #region 连续小球
                if (fi.szSelectFilterType == "连续小球")
                {
                    int smallmore = 0;
                    List<int> smallmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hosthistorylist)
                    {
                        if (OddsUntil.overUnder[Convert.ToInt32(hvs.overunder) + 1] == "小")
                        {
                            smallmore++;
                        }
                        else
                        {
                            if (smallmore > 0)
                                smallmorecount.Add(smallmore);
                            smallmore = 0;
                        }
                    }

                    foreach (int data in smallmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion

                //近期主队主 战绩 客队客场战绩过滤
                //"连胜", "连平","连负","连赢盘","连走盘" "连输盘","连续大球","连续小球"
                #region 连胜
                if (fi.szSelectFilterType == "连胜")
                {
                    int wincomeon = 0;
                    List<int> wincount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "胜")
                        {
                            wincomeon++;
                        }
                        else
                        {
                            if (wincomeon > 0)
                                wincount.Add(wincomeon);
                            wincomeon = 0;
                        }
                    }

                    foreach (int data in wincount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }

                           

                        }

                    }

                }
                #endregion
                #region 连平
                if (fi.szSelectFilterType == "连平")
                {
                    int pingmore = 0;
                    List<int> pingmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "平")
                        {
                            pingmore++;
                        }
                        else
                        {
                            if (pingmore > 0)
                                pingmorecount.Add(pingmore);
                            pingmore = 0;
                        }
                    }

                    foreach (int data in pingmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }

                           

                        }

                    }

                }
                #endregion
                #region 连负
                if (fi.szSelectFilterType == "连负")
                {
                    int fumore = 0;
                    List<int> fumorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "负")
                        {
                            fumore++;
                        }
                        else
                        {
                            if (fumore > 0)
                                fumorecount.Add(fumore);
                            fumore = 0;
                        }
                    }

                    foreach (int data in fumorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }

                           

                        }

                    }

                }
                #endregion
                #region 连赢盘
                if (fi.szSelectFilterType == "连赢盘")
                {
                    int winpanlu = 0;
                    List<int> winpanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "赢")
                        {
                            winpanlu++;
                        }
                        else
                        {
                            if (winpanlu > 0)
                                winpanlucount.Add(winpanlu);
                            winpanlu = 0;
                        }
                    }

                    foreach (int data in winpanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }


                            

                        }

                    }

                }
                #endregion
                #region 连走盘
                if (fi.szSelectFilterType == "连走盘")
                {
                    int zoupanlu = 0;
                    List<int> zoupanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "走")
                        {
                            zoupanlu++;
                        }
                        else
                        {
                            if (zoupanlu > 0)
                                zoupanlucount.Add(zoupanlu);
                            zoupanlu = 0;
                        }
                    }

                    foreach (int data in zoupanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {

                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion
                #region 连输盘
                if (fi.szSelectFilterType == "连输盘")
                {
                    int shupanlu = 0;
                    List<int> shupanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "输")
                        {
                            shupanlu++;
                        }
                        else
                        {
                            if (shupanlu > 0)
                                shupanlucount.Add(shupanlu);
                            shupanlu = 0;
                        }
                    }

                    foreach (int data in shupanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {

                            if (Uicontrol != null)
                            {

                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion
                #region 连续大球
                if (fi.szSelectFilterType == "连续大球")
                {
                    int bigmore = 0;
                    List<int> bigmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (OddsUntil.overUnder[Convert.ToInt32(hvs.overunder) + 1] == "大")
                        {
                            bigmore++;
                        }
                        else
                        {
                            if (bigmore > 0)
                                bigmorecount.Add(bigmore);
                            bigmore = 0;
                        }
                    }

                    foreach (int data in bigmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {

                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion
                #region 连续小球
                if (fi.szSelectFilterType == "连续小球")
                {
                    int smallmore = 0;
                    List<int> smallmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (OddsUntil.overUnder[Convert.ToInt32(hvs.overunder) + 1] == "小")
                        {
                            smallmore++;
                        }
                        else
                        {
                            if (smallmore > 0)
                                smallmorecount.Add(smallmore);
                            smallmore = 0;
                        }
                    }

                    foreach (int data in smallmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {

                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.HOST + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.HOST + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion

                // 主队最近10场胜负,输赢,大小球,
                if (Hashresult != null)
                {
                    int count = 0;
                    foreach (Bet007_HistoryVS hvs in ba.hostmatchhistorylist)
                    {
                        if (count < 10)
                        {
  
                        }
                        count++;
                    }
                }
                
                //近期客队战绩
                //"连胜", "连平","连负","连赢盘","连走盘" "连输盘","连续大球","连续小球"
                #region 连胜
                if (fi.szSelectFilterType == "连胜")
                {
                    int wincomeon = 0;
                    List<int> wincount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.visthistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "胜")
                        {
                            wincomeon++;
                        }
                        else
                        {
                            if (wincomeon > 0)
                                wincount.Add(wincomeon);
                            wincomeon = 0;
                        }
                    }

                    foreach (int data in wincount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if(Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }

                        }

                    }

                }
                #endregion
                #region 连平
                if (fi.szSelectFilterType == "连平")
                {
                    int pingmore = 0;
                    List<int> pingmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.visthistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "平")
                        {
                            pingmore++;
                        }
                        else
                        {
                            if (pingmore > 0)
                                pingmorecount.Add(pingmore);
                            pingmore = 0;
                        }
                    }

                    foreach (int data in pingmorecount)
                    {

                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion
                #region 连负
                if (fi.szSelectFilterType == "连负")
                {
                    int fumore = 0;
                    List<int> fumorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.visthistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "负")
                        {
                            fumore++;
                        }
                        else
                        {
                            if (fumore > 0)
                                fumorecount.Add(fumore);
                            fumore = 0;
                        }
                    }

                    foreach (int data in fumorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {

                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion
                #region 连赢盘
                if (fi.szSelectFilterType == "连赢盘")
                {
                    int winpanlu = 0;
                    List<int> winpanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.visthistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "赢")
                        {
                            winpanlu++;
                        }
                        else
                        {
                            if (winpanlu > 0)
                                winpanlucount.Add(winpanlu);
                            winpanlu = 0;
                        }
                    }

                    foreach (int data in winpanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {

                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion
                #region 连走盘
                if (fi.szSelectFilterType == "连走盘")
                {
                    int zoupanlu = 0;
                    List<int> zoupanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.visthistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "走")
                        {
                            zoupanlu++;
                        }
                        else
                        {
                            if (zoupanlu > 0)
                                zoupanlucount.Add(zoupanlu);
                            zoupanlu = 0;
                        }
                    }

                    foreach (int data in zoupanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {

                            if (Uicontrol != null)
                            {

                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }


                        }

                    }

                }
                #endregion
                #region 连输盘
                if (fi.szSelectFilterType == "连输盘")
                {
                    int shupanlu = 0;
                    List<int> shupanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.visthistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "输")
                        {
                            shupanlu++;
                        }
                        else
                        {
                            if (shupanlu > 0)
                                shupanlucount.Add(shupanlu);
                            shupanlu = 0;
                        }
                    }

                    foreach (int data in shupanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if(Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }

                        }

                    }

                }
                #endregion
                #region 连续大球
                if (fi.szSelectFilterType == "连续大球")
                {
                    int bigmore = 0;
                    List<int> bigmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.visthistorylist)
                    {
                        if (OddsUntil.overUnder[Convert.ToInt32(hvs.overunder) + 1] == "大")
                        {
                            bigmore++;
                        }
                        else
                        {
                            if (bigmore > 0)
                                bigmorecount.Add(bigmore);
                            bigmore = 0;
                        }
                    }

                    foreach (int data in bigmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连续小球
                if (fi.szSelectFilterType == "连续小球")
                {
                    int smallmore = 0;
                    List<int> smallmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.visthistorylist)
                    {
                        if (OddsUntil.overUnder[Convert.ToInt32(hvs.overunder) + 1] == "小")
                        {
                            smallmore++;
                        }
                        else
                        {
                            if (smallmore > 0)
                                smallmorecount.Add(smallmore);
                            smallmore = 0;
                        }
                    }

                    foreach (int data in smallmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                           

                        }

                    }

                }
                #endregion

                //近期客队 客场战绩
                //"连胜", "连平","连负","连赢盘","连走盘" "连输盘","连续大球","连续小球"
                #region 连胜
                if (fi.szSelectFilterType == "连胜")
                {
                    int wincomeon = 0;
                    List<int> wincount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.vistmatchhistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "胜")
                        {
                            wincomeon++;
                        }
                        else
                        {
                            if (wincomeon > 0)
                                wincount.Add(wincomeon);
                            wincomeon = 0;
                        }
                    }

                    foreach (int data in wincount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连平
                if (fi.szSelectFilterType == "连平")
                {
                    int pingmore = 0;
                    List<int> pingmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.vistmatchhistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "平")
                        {
                            pingmore++;
                        }
                        else
                        {
                            if (pingmore > 0)
                                pingmorecount.Add(pingmore);
                            pingmore = 0;
                        }
                    }

                    foreach (int data in pingmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            
                        }

                    }

                }
                #endregion
                #region 连负
                if (fi.szSelectFilterType == "连负")
                {
                    int fumore = 0;
                    List<int> fumorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.vistmatchhistorylist)
                    {
                        if (OddsUntil.result[Convert.ToInt32(hvs.result) + 1] == "负")
                        {
                            fumore++;
                        }
                        else
                        {
                            if (fumore > 0)
                                fumorecount.Add(fumore);
                            fumore = 0;
                        }
                    }

                    foreach (int data in fumorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连赢盘
                if (fi.szSelectFilterType == "连赢盘")
                {
                    int winpanlu = 0;
                    List<int> winpanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.vistmatchhistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "赢")
                        {
                            winpanlu++;
                        }
                        else
                        {
                            if (winpanlu > 0)
                                winpanlucount.Add(winpanlu);
                            winpanlu = 0;
                        }
                    }

                    foreach (int data in winpanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连走盘
                if (fi.szSelectFilterType == "连走盘")
                {
                    int zoupanlu = 0;
                    List<int> zoupanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.vistmatchhistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "走")
                        {
                            zoupanlu++;
                        }
                        else
                        {
                            if (zoupanlu > 0)
                                zoupanlucount.Add(zoupanlu);
                            zoupanlu = 0;
                        }
                    }

                    foreach (int data in zoupanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连输盘
                if (fi.szSelectFilterType == "连输盘")
                {
                    int shupanlu = 0;
                    List<int> shupanlucount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.vistmatchhistorylist)
                    {
                        if (OddsUntil.panlu[Convert.ToInt32(hvs.panlu) + 2] == "输")
                        {
                            shupanlu++;
                        }
                        else
                        {
                            if (shupanlu > 0)
                                shupanlucount.Add(shupanlu);
                            shupanlu = 0;
                        }
                    }

                    foreach (int data in shupanlucount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;

                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            
                        }

                    }

                }
                #endregion
                #region 连续大球
                if (fi.szSelectFilterType == "连续大球")
                {
                    int bigmore = 0;
                    List<int> bigmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.vistmatchhistorylist)
                    {
                        if (OddsUntil.overUnder[Convert.ToInt32(hvs.overunder) + 1] == "大")
                        {
                            bigmore++;
                        }
                        else
                        {
                            if (bigmore > 0)
                                bigmorecount.Add(bigmore);
                            bigmore = 0;
                        }
                    }

                    foreach (int data in bigmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion
                #region 连续小球
                if (fi.szSelectFilterType == "连续小球")
                {
                    int smallmore = 0;
                    List<int> smallmorecount = new List<int>();
                    foreach (Bet007_HistoryVS hvs in ba.vistmatchhistorylist)
                    {
                        if (OddsUntil.overUnder[Convert.ToInt32(hvs.overunder) + 1] == "小")
                        {
                            smallmore++;
                        }
                        else
                        {
                            if (smallmore > 0)
                                smallmorecount.Add(smallmore);
                            smallmore = 0;
                        }
                    }

                    foreach (int data in smallmorecount)
                    {
                        if (data >= Convert.ToInt32(fi.szFilter))
                        {
                            if (Uicontrol != null)
                            {
                                MatchListDataTemple matchlistdatatemple = OddsUntil.MathViewTemple[OddsUntil.GetMathViewKey(ci.mId, "1")] as MatchListDataTemple;
                                if (matchlistdatatemple != null && !matchlist.Contains(matchlistdatatemple))
                                {

                                    Uicontrol.GetDispatcher().BeginInvoke((Action)(() =>
                                    {
                                        matchlist.Add(matchlistdatatemple);
                                        Uicontrol.NotifyFilterMatchOk();
                                    }));
                                }
                                else
                                {
                                    Console.WriteLine("matchlistdatatemple null " + bi.t1CnName);
                                }
                                break;
                            }
                            else if (Hashresult != null)
                            {
                                Hashresult.Remove(OddsUntil.VISIT + fi.szSelectFilterType);
                                Hashresult.Add(OddsUntil.VISIT + fi.szSelectFilterType, data);
                            }
                            

                        }

                    }

                }
                #endregion




            }        

        }
    }
}
